package com.yang.runnable;

import javax.servlet.AsyncContext;
import javax.servlet.ServletResponse;

public class AsyRunnable implements Runnable{
    private AsyncContext asyncContext;
    public AsyRunnable(AsyncContext asyncContext) {
        this.asyncContext=asyncContext;
    }

    @Override
    public void run() {
        try {
            Thread.sleep(5000);
            ServletResponse response = asyncContext.getResponse();
            response.getWriter().print("lkkkk");
            response.getWriter().print("dddddd");
            //asyncContext.complete();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
